var coreExamTmpl = Gikam.getPageObject({

    baseUrl : IFM_CONTEXT + '/secure/baseline/rm/train/exam-tmpls',

    getEditListColumns : function() {
        return [ {
            checkbox : true,
        },{index: true}, {
            field : 'tmplName',
            title : 'T_CORE_EXAM_TMPL.TMPLNAME',
            width : 200,
            type : 'link'
        }, {
            field : 'singleChoiceQty',
            width : 100,
            title : 'T_CORE_EXAM_TMPL.SINGLECHOICEQTY'
        }, {
            field : 'singleChoiceScore',
            width : 150,
            title : 'T_CORE_EXAM_TMPL.SINGLECHOICESCORE'
        }, {
            field : 'multipleChoiceQty',
            width : 100,
            title : 'T_CORE_EXAM_TMPL.MULTIPLECHOICEQTY'
        }, {
            field : 'multipleChoiceScore',
            width : 150,
            title : 'T_CORE_EXAM_TMPL.MULTIPLECHOICESCORE'
        }, {
            field : 'completionQty',
            width : 100,
            title : 'T_CORE_EXAM_TMPL.COMPLETIONQTY'
        }, {
            field : 'completionScore',
            width : 150,
            title : 'T_CORE_EXAM_TMPL.COMPLETIONSCORE'
        }, {
            field : 'judgementQty',
            width : 100,
            title : 'T_CORE_EXAM_TMPL.JUDGEMENTQTY'
        }, {
            field : 'judgementScore',
            width : 150,
            title : 'T_CORE_EXAM_TMPL.JUDGEMENTSCORE'
        }, {
            field : 'shortAnswerQty',
            width : 100,
            title : 'T_CORE_EXAM_TMPL.SHORTANSWERQTY'
        }, {
            field : 'shortAnswerScore',
            width : 150,
            title : 'T_CORE_EXAM_TMPL.SHORTANSWERSCORE'
        }, {
            field : 'totalScore',
            width : 100,
            title : 'T_CORE_EXAM_TMPL.TOTALSCORE'
        } ];
    },
    
    getBaseInfoFormFields : function() {
        return [ {
            field : 'tmplName',
            title : 'T_CORE_EXAM_TMPL.TMPLNAME',
            preInsert : true,
            validators : [ 'notEmpty', 'strLength(0,90]' ],
            colspan : 2
        }, {
            field : 'singleChoiceQty',
            title : 'T_CORE_EXAM_TMPL.SINGLECHOICEQTY',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    singleChoiceQty : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'singleChoiceScore',
            title : 'T_CORE_EXAM_TMPL.SINGLECHOICESCORE',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    singleChoiceScore : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'multipleChoiceQty',
            title : 'T_CORE_EXAM_TMPL.MULTIPLECHOICEQTY',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    multipleChoiceQty : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'multipleChoiceScore',
            title : 'T_CORE_EXAM_TMPL.MULTIPLECHOICESCORE',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    multipleChoiceScore : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'completionQty',
            title : 'T_CORE_EXAM_TMPL.COMPLETIONQTY',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    completionQty : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'completionScore',
            title : 'T_CORE_EXAM_TMPL.COMPLETIONSCORE',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    completionScore : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'judgementQty',
            title : 'T_CORE_EXAM_TMPL.JUDGEMENTQTY',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    judgementQty : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'judgementScore',
            title : 'T_CORE_EXAM_TMPL.JUDGEMENTSCORE',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    judgementScore : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'shortAnswerQty',
            title : 'T_CORE_EXAM_TMPL.SHORTANSWERQTY',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    shortAnswerQty : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'shortAnswerScore',
            title : 'T_CORE_EXAM_TMPL.SHORTANSWERSCORE',
            validators : [ 'integer','numRange[0,1000]' ],
            onChange : function(field, value) {
                var totalScore = coreExamTmpl.detailPage.calcTotalScore(field, value);
                Gikam.getComp('core-exam-tmpl-detail-base-info-form').setData({
                    shortAnswerScore : value,
                    totalScore : totalScore
                });
            }
        }, {
            field : 'totalScore',
            title : 'T_CORE_EXAM_TMPL.TOTALSCORE',
            readonly : true
        } ];
    },
    
    getChooseListColumns : function() {
        return [ {index: true},{
            field : 'tmplName',
            title : 'T_CORE_EXAM_TMPL.TMPLNAME',
            width : 200,
            type : 'link'
        }, {
            field : 'singleChoiceQty',
            width : 100,
            title : 'T_CORE_EXAM_TMPL.SINGLECHOICEQTY'
        }, {
            field : 'singleChoiceScore',
            title : 'T_CORE_EXAM_TMPL.SINGLECHOICESCORE',
            width : 150,
        }, {
            field : 'multipleChoiceQty',
            title : 'T_CORE_EXAM_TMPL.MULTIPLECHOICEQTY',
            width : 100,
        }, {
            field : 'multipleChoiceScore',
            title : 'T_CORE_EXAM_TMPL.MULTIPLECHOICESCORE',
            width : 150
        }, {
            field : 'completionQty',
            title : 'T_CORE_EXAM_TMPL.COMPLETIONQTY',
            width : 100
        }, {
            field : 'completionScore',
            title : 'T_CORE_EXAM_TMPL.COMPLETIONSCORE',
            width : 150
        }, {
            field : 'judgementQty',
            title : 'T_CORE_EXAM_TMPL.JUDGEMENTQTY',
            width : 100
        }, {
            field : 'judgementScore',
            title : 'T_CORE_EXAM_TMPL.JUDGEMENTSCORE',
            width : 150
        }, {
            field : 'shortAnswerQty',
            title : 'T_CORE_EXAM_TMPL.SHORTANSWERQTY',
            width : 100
        }, {
            field : 'shortAnswerScore',
            title : 'T_CORE_EXAM_TMPL.SHORTANSWERSCORE',
            width : 150
        }, {
            field : 'totalScore',
            title : 'T_CORE_EXAM_TMPL.TOTALSCORE',
            width : 100
        } ];
    }
});